import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { UserInfoData, UserInfoService } from 'src/app/service/user-info/user-info.service';

@Component({
  selector: 'app-the-top',
  templateUrl: './the-top.component.html',
  styleUrls: ['./the-top.component.scss']
})
export class TheTopComponent implements OnInit {

  constructor(
    private router: Router,
    private userInfoService: UserInfoService
  ) { }

  userInfo: any = null
  ngOnInit(): void {
    this.pageInit()
  }

  pageInit(){
    this.userInfoService.userInfo$.subscribe(res => {
      this.userInfo = res
    })
  }

  goLoginPage(){
    this.router.navigate(['/login'])
  }
  goMe(){
    this.router.navigate(['/me'])
  }

}
